package com.reger.test.l2cache;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationListener;

import com.reger.l2cache.cache.annotation.EnableL2Cache;
import com.reger.l2cache.serverid.event.ServerIdRefreshApplicationEvent;


@SpringBootApplication
@EnableL2Cache(exposeProxy = true, proxyTargetClass = true)
public class SpringBootStarterL2cacheApplication implements CommandLineRunner,ApplicationListener<ServerIdRefreshApplicationEvent> {

	private static final Logger log = LoggerFactory.getLogger(SpringBootStarterL2cacheApplication.class);

	public static void main(String[] args) throws InterruptedException {
		 SpringApplication.run(SpringBootStarterL2cacheApplication.class, args).close();
	}

	
	@Override
	public void run(String... args) throws Exception {
		
	}

	@Override
	public void onApplicationEvent(ServerIdRefreshApplicationEvent event) {
		System.err.println(event.getServerId());
	}

}
